package com.xxxx.web.dto;

import com.xxxx.web.entity.*;
import com.xxxx.web.enums.*;
import com.xxxx.web.tools.dto.BaseDto;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;

/**
 * 商品分类表类
 */
@Data
public class CargoTypeDto extends BaseDto {


    /**
     * 名称
     */
    @JsonProperty("Name")
    private String Name;


    /**
     * 仓库
     */
    @JsonProperty("WarehouseId")
    private Integer WarehouseId;

    @JsonProperty("WarehouseDto")
    private WarehouseDto WarehouseDto;

    /**
     * 把商品分类表传输模型转换成商品分类表实体
     */
    public CargoType MapToEntity() throws InvocationTargetException, IllegalAccessException {
        CargoType CargoType = new CargoType();

        BeanUtils.copyProperties(CargoType, this);

        return CargoType;
    }

}
